import Vue from 'vue'
import Router from 'vue-router'

// 五个Tab页全部预加载
import Home from '@/pages/home/home'
import Address from '@/pages/address/address'
import MeiTu from '@/pages/meiTu/meiTu'
import Cart from '@/pages/cart/cart'
import User from '@/pages/User/User'
Vue.use(Router)

// 首页
const HiPlay = () => import('@/pages/home/homeSecondary/hiPlay')
const VideoSet = () => import('@/pages/home/homeSecondary/videoSet')
const PanoramaSet = () => import('@/pages/home/homeSecondary/panoramaSet')
const HiPlayStrategyList = () => import('@/pages/home/homeSecondary/hiPlayStrategyList')
const HomeContentManagement = () => import('@/pages/home/homeContentManagement')
const DrawingMap = () => import('@/pages/home/drawingMap/drawingMap')
const TouristTrack = () => import('@/pages/home/touristTrack/touristTrack')

// 目的地
const AddressMap = () => import('@/pages/address/map/map')
const Strategy = () => import('@/pages/address/playStrategy/strategy')
const StrategyDetail = () => import('@/pages/address/playStrategy/strategyDetail')
const Travels = () => import('@/pages/address/playStrategy/travels')
const StrategyList = () => import('@/pages/address/playStrategy/strategyList')
const TravelsList = () => import('@/pages/address/playStrategy/travelsList')
const Drafts = () => import('@/pages/address/playStrategy/drafts')
const TravelsEdit = () => import('@/pages/address/publishTravels/travelsEdit')
const TravelsPerfect = () => import('@/pages/address/publishTravels/travelsPerfect')

// 美途
const UserDynamic = () => import('@/pages/meiTu/userDynamic/userDynamic')
const TagDynamic = () => import('@/pages/meiTu/tagDynamic/tagDynamic')
const PublishDynamic = () => import('@/pages/meiTu/publishDynamic/publishDynamic')
const SelectTag = () => import('@/pages/meiTu/publishDynamic/selectTag')
const GetAddress = () => import('@/pages/meiTu/publishDynamic/getAddress')
const DynamicDesc = () => import('@/pages/meiTu/dynamicDesc/dynamicDesc')

// 商城
const ScenicList = () => import('@/pages/cart/cart-page/scenic/scenicList')
const Scenic = () => import('@/pages/cart/cart-page/scenic/scenic')
const ScenicToliet = () => import('@/pages/cart/cart-page/scenic/scenicToliet')
const ScenicGuide = () => import('@/pages/cart/cart-page/scenic/scenicGuide')
const ScenicGuideDesc = () => import('@/pages/cart/cart-page/scenic/scenicGuideDesc')
const ScenicVideoSet = () => import('@/pages/cart/cart-page/scenic/scenicVideoSet')
const ScenicOrder = () => import('@/pages/cart/cart-page/scenic/scenicOrder')
const ScenicGuideOrder = () => import('@/pages/cart/cart-page/scenic/scenicGuideOrder')
const ScenicGuideOrderDetail = () => import('@/pages/cart/cart-page/scenic/scenicGuideOrderDetail')
const ScenicOrderDetail = () => import('@/pages/cart/cart-page/scenic/scenicOrderDetail')

const HotelPortal = () => import('@/pages/cart/cart-page/hotel/hotelPortal')
const HotelList = () => import('@/pages/cart/cart-page/hotel/hotelList')
const Hotel = () => import('@/pages/cart/cart-page/hotel/hotel')
const HotelOrder = () => import('@/pages/cart/cart-page/hotel/hotelOrder')
const HotelOrderDetail = () => import('@/pages/cart/cart-page/hotel/hotelOrderDetail')

const ServiceMap = () => import('@/pages/cart/serviceMap')
const CommentList = () => import('@/pages/cart/cartComment/commentList')
const CartComment = () => import('@/pages/cart/cartComment/comment')

const SpecialLocalProduct = () => import('@/pages/cart/cart-page/specialLocal-product/specialLocal-product')
const SpecialLocalProductDetail = () => import('@/pages/cart/cart-page/specialLocal-product/specialLocal-product-detail')
const Food = () => import('@/pages/cart/cart-page/food/food')
const FoodDescribe = () => import('@/pages/cart/cart-page/food/foodDescribe')
const StoreDescribe = () => import('@/pages/cart/cart-page/food/storeDescribe')
const FoodList = () => import('@/pages/cart/cart-page/food/foodDetails/foodList')
const FoodDetailsOne = () => import('@/pages/cart/cart-page/food/foodDetails/foodDetailsOne')

// 我的
const Login = () => import('@/pages/user/login/login')
const Register = () => import('@/pages/user/login/register')
const ForgetPass = () => import('@/pages/user/login/forgetPass')
const BindPhone = () => import('@/pages/user/login/bindPhone')
const OrderList = () => import('@/pages/user/orderList')
const Order = () => import('@/pages/user/order/order')
const OrderDesc = () => import('@/pages/user/order/orderdesc')
const OrderQuitServer = () => import('@/pages/user/order/orderquitserver')
const OrderQuitServerDesc = () => import('@/pages/user/order/orderquitserverdesc')
const About = () => import('@/pages/user/about/about')
const Privacy = () => import('@/pages/user/about/privacy')
const ServerCase = () => import('@/pages/user/about/server')
const Collection = () => import('@/pages/user/collection/collection')
const Browse = () => import('@/pages/user/browse/browse')
const Setting = () => import('@/pages/user/setting/setting')
const PersonMessage = () => import('@/pages/user/editmessage/personmessage')
const Fans = () => import('@/pages/user/follower/fans')
const Focus = () => import('@/pages/user/follower/focus')
const Evalution = () => import('@/pages/user/order/evalution')
const MessageList = () => import('@/pages/user/message/messageList')
const Friends = () => import('@/pages/user/publish/friends')
const NewFriends = () => import('@/pages/user/publish/newfriends')
const Praise = () => import('@/pages/user/publish/praise')
const Archives = () => import('@/pages/user/archives/archives')
const EvalutionDesc = () => import('@/pages/user/archives/evalutiondesc')
const TravelMiddle = () => import('@/pages/user/archives/travelmiddle')
const HarvestAddress = () => import('@/pages/user/setting/harvestaddress')
const ModifyAddress = () => import('@/pages/user/setting/modifyaddress')
const AddAddress = () => import('@/pages/user/setting/addaddress')
const ShoppingCart = () => import('@/pages/user/shopping/shoppingcart')
const SubmitOrder = () => import('@/pages/user/shopping/submitorder')
const ShoppingList = () => import('@/pages/user/shopping/shoppinglist')
const OpenInvoice = () => import('@/pages/user/shopping/openinvoice')
const Logistics = () => import('@/pages/user/order/logistics')
const PhotoWall = () => import('@/pages/user/archives/photowall')

const Chat = () => import('@/components/chat/chat')
const ChatAI = () => import('@/components/chat/chatAI')

const CommontContent = () => import('@/pages/commonContent/content')
const Iframe = () => import('@/pages/commonContent/iframe')
const CommonReport = () => import('@/pages/report/report')
const Debug = () => import('@/pages/debug/debug')

const RouterInstance = new Router({
  // mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: 'hiPlay',
          name: 'HiPlay',
          component: HiPlay
        },
        {
          path: 'videoSet/:type',
          name: 'VideoSet',
          component: VideoSet
        },
        {
          path: 'panoramaSet/:type',
          name: 'PanoramaSet',
          component: PanoramaSet
        },
        {
          path: 'hiPlayStrategyList',
          name: 'HiPlayStrategyList',
          component: HiPlayStrategyList
        },
        {
          path: 'homeContentManagement/:contentId',
          name: 'HomeContentManagement',
          component: HomeContentManagement
        },
        {
          path: 'drawingMap',
          name: 'DrawingMap',
          component: DrawingMap
        },
        {
          path: 'touristTrack/:id',
          name: 'TouristTrack',
          component: TouristTrack
        }
      ]
    },
    {
      path: '/address',
      name: 'Address',
      component: Address,
      children: [
        {
          path: 'strategy/:strategyId',
          name: 'Strategy',
          component: Strategy
        },
        {
          path: 'strategyDetail/:strategyId',
          name: 'StrategyDetail',
          component: StrategyDetail
        },
        {
          path: 'strategyList',
          name: 'StrategyList',
          component: StrategyList
        },
        {
          path: 'travels/:travelsId',
          name: 'Travels',
          component: Travels
        },
        {
          path: 'travelsList',
          name: 'TravelsList',
          component: TravelsList
        },
        {
          path: 'drafts',
          name: 'Drafts',
          component: Drafts
        },
        {
          path: 'travelsEdit/:type',
          name: 'TravelsEdit',
          component: TravelsEdit
        },
        {
          path: 'travelsPerfect/:id',
          name: 'TravelsPerfect',
          component: TravelsPerfect
        }
      ]
    },
    {
      path: '/meiTu',
      name: 'MeiTu',
      component: MeiTu,
      children: [
        {
          path: 'publishDynamic',
          name: 'PublishDynamic',
          component: PublishDynamic,
          children: [
            {
              path: 'selectTag',
              name: 'SelectTag',
              component: SelectTag
            },
            {
              path: 'getAddress',
              name: 'GetAddress',
              component: GetAddress
            }
          ]
        },
        {
          path: 'dynamicDesc/:dynamicId',
          name: 'DynamicDesc',
          component: DynamicDesc
        },
        {
          path: 'userDynamic/:userId',
          name: 'UserDynamic',
          component: UserDynamic
        },
        {
          path: 'tagDynamic/:tagId',
          name: 'TagDynamic',
          component: TagDynamic
        }
      ]
    },
    {
      path: '/cart',
      name: 'Cart',
      component: Cart,
      children: [
        {
          path: '/foodList',
          name: 'FoodList',
          component: FoodList
        },
        {
          path: '/foodDetailsOne/:id',
          name: 'FoodDetailsOne',
          component: FoodDetailsOne
        }
      ]
    },
    // 景区部分
    {
      path: '/scenicList',
      name: 'ScenicList',
      component: ScenicList
    },
    {
      path: '/scenic/:id',
      name: 'Scenic',
      component: Scenic
    },
    {
      path: '/scenicToliet',
      name: 'ScenicToliet',
      component: ScenicToliet
    },
    {
      path: '/scenicGuide/:id',
      name: 'ScenicGuide',
      component: ScenicGuide
    },
    {
      path: '/scenicGuideDesc/:id',
      name: 'ScenicGuideDesc',
      component: ScenicGuideDesc
    },
    {
      path: '/scenicVideoSet/:id',
      name: 'ScenicVideoSet',
      component: ScenicVideoSet
    },
    {
      path: '/scenicOrder',
      name: 'ScenicOrder',
      component: ScenicOrder
    },
    {
      path: '/scenicGuideOrder',
      name: 'ScenicGuideOrder',
      component: ScenicGuideOrder
    },
    {
      path: '/scenicOrderDetail/:tradeNo',
      name: 'ScenicOrderDetail',
      component: ScenicOrderDetail
    },
    {
      path: '/ScenicGuideOrderDetail/:tradeNo',
      name: 'ScenicGuideOrderDetail',
      component: ScenicGuideOrderDetail
    },
    // 酒店部分
    {
      path: '/hotelPortal',
      name: 'HotelPortal',
      component: HotelPortal
    },
    {
      path: '/hotelList',
      name: 'HotelList',
      component: HotelList
    },
    {
      path: '/hotel/:id',
      name: 'Hotel',
      component: Hotel
    },
    {
      path: '/hotelOrder',
      name: 'HotelOrder',
      component: HotelOrder
    },
    {
      path: '/hotelOrderDetail/:tradeNo',
      name: 'HotelOrderDetail',
      component: HotelOrderDetail
    },
    {
      path: '/commentList/:productId/:type',
      name: 'CommentList',
      component: CommentList
    },
    {
      path: '/comment/:commentId',
      name: 'CartComment',
      component: CartComment
    },
    {
      path: '/serviceMap/:id/:type',
      name: 'ServiceMap',
      component: ServiceMap
    },
    {
      path: '/specialLocalProduct',
      name: 'SpecialLocalProduct',
      component: SpecialLocalProduct
    },
    {
      path: '/food',
      name: 'Food',
      component: Food
    },
    {
      path: '/specialLocalProductDetail/:id',
      name: 'SpecialLocalProductDetail',
      component: SpecialLocalProductDetail
    },
    {
      path: '/foodDescribe/:id',
      name: 'FoodDescribe',
      component: FoodDescribe
    },
    {
      path: '/storeDescribe/:contentId',
      name: 'StoreDescribe',
      component: StoreDescribe
    },
    {
      path: '/orderdesc/:outTradeId',
      name: 'OrderDesc',
      component: OrderDesc
    },
    {
      path: '/user',
      name: 'User',
      component: User,
      children: [
        {
          path: 'order',
          name: 'Order',
          component: Order
        },
        {
          path: 'evalution/:productId',
          name: 'Evalution',
          component: Evalution
        },
        {
          path: 'orderquitserver',
          name: 'OrderQuitServer',
          component: OrderQuitServer
        },
        {
          path: 'orderquitserverdesc/:outTradeId',
          name: 'OrderQuitServerDesc',
          component: OrderQuitServerDesc
        },
        {
          path: 'about',
          name: 'About',
          component: About
        },
        {
          path: 'collection',
          name: 'Collection',
          component: Collection
        },
        {
          path: 'browse',
          name: 'Browse',
          component: Browse
        },
        {
          path: 'setting',
          name: 'Setting',
          component: Setting
        },
        {
          path: 'personmessage',
          name: 'PersonMessage',
          component: PersonMessage
        },
        {
          path: 'fans/:userId',
          name: 'Fans',
          component: Fans
        },
        {
          path: 'focus/:userId',
          name: 'Focus',
          component: Focus
        },
        {
          path: 'messageList',
          name: 'MessageList',
          component: MessageList
        },
        {
          path: 'friends',
          name: 'Friends',
          component: Friends
        },
        {
          path: 'newfriends',
          name: 'NewFriends',
          component: NewFriends
        },
        {
          path: 'praise',
          name: 'Praise',
          component: Praise
        },
        {
          path: 'archives/:userId',
          name: 'Archives',
          component: Archives
        },
        {
          path: 'evalutionDesc',
          name: 'EvalutionDesc',
          component: EvalutionDesc
        },
        {
          path: 'travelmiddle',
          name: 'TravelMiddle',
          component: TravelMiddle
        },
        {
          path: 'harvestaddress',
          name: 'HarvestAddress',
          component: HarvestAddress
        },
        {
          path: 'modifyaddress/:addressId',
          name: 'ModifyAddress',
          component: ModifyAddress
        },
        {
          path: 'addaddress',
          name: 'AddAddress',
          component: AddAddress
        },
        {
          path: 'shoppingcart',
          name: 'ShoppingCart',
          component: ShoppingCart
        },
        {
          path: 'submitorder',
          name: 'SubmitOrder',
          component: SubmitOrder
        },
        {
          path: 'shoppinglist',
          name: 'ShoppingList',
          component: ShoppingList
        },
        {
          path: 'openinvoice',
          name: 'OpenInvoice',
          component: OpenInvoice
        },
        {
          path: 'logistics/:awbId',
          name: 'Logistics',
          component: Logistics
        },
        {
          path: 'photowall/:userId',
          name: 'PhotoWall',
          component: PhotoWall
        }
      ]
    },
    {
      path: '/orderList',
      name: 'OrderList',
      component: OrderList
    },
    {
      path: '/chat',
      name: 'Chat',
      component: Chat
    },
    {
      path: '/chatAI',
      name: 'ChatAI',
      component: ChatAI
    },
    {
      path: '/content/:contentId/:title',
      name: 'CommontContent',
      component: CommontContent
    },
    {
      path: '/iframe',
      name: 'Iframe',
      component: Iframe
    },
    {
      path: '/commonReport/:targetType/:targetId',
      name: 'CommonReport',
      component: CommonReport
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      children: [
        {
          path: 'register',
          name: 'Register',
          component: Register
        },
        {
          path: 'bindPhone',
          name: 'BindPhone',
          component: BindPhone
        },
        {
          path: 'forgetPass',
          name: 'ForgetPass',
          component: ForgetPass
        }
      ]
    },
    {
      path: '/debug',
      name: 'Debug',
      component: Debug
    },
    {
      path: '/privacy',
      name: 'Privacy',
      component: Privacy
    },
    {
      path: '/servercase',
      name: 'ServerCase',
      component: ServerCase
    },
    {
      path: '/addressMap/:addressId/:type',
      name: 'AddressMap',
      component: AddressMap
    }
  ]
})

export default RouterInstance
